#! /usr/bin/python
# Filename: class_objvar.py

class Person:
	'''Represents a person.'''
	population = 0;

	def __init__(self,name):
		self.name = name;
		print '(Initializing %s)' % self.name;
		Person.population += 1;

	
	def sayHi(self):
		print 'Hi,my name is', self.name;

	def howMany(self):
		if Person.population == 1:
			print 'I am the only person here';
		else:
			print 'We have %d persons here.' % Person.population;

	def __del__(self):
		print '%s says bye.' % self.name;
		if Person.population == 1:
			print 'I am the only person here.';
		elif Person.population > 1:
			print 'We have %d persons here.' % (Person.population - 1);

		Person.population -= 1;

	
andy = Person('Andy');
andy.sayHi();
andy.howMany();

kalam = Person('Kalam');
kalam.sayHi();
kalam.howMany();

andy.sayHi();
andy.howMany();


